package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.entities.CommonResult;
import com.atguigu.springcloud.entities.Payment;
import com.atguigu.springcloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequestMapping("/consumer")
public class OrderController {

	@Autowired
	private PaymentFeignService paymentFeignService;
	
	@GetMapping("/payment/{id}")
	public CommonResult<Payment> get(@PathVariable("id")long id){
		return paymentFeignService.get(id);
	}
	
	@GetMapping("/payment/timeout")
	public String feginTimeout(){
		return paymentFeignService.paymentFeignTimeout();
	}

}
